// pages/perCenter/personInfo/personInfo.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    customerInfo:{}
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    var token = wx.getStorageSync("token");
    if(token){
      //登录状态
      var customerInfo = that.data.customerInfo;
      customerInfo['type']=options.type;
      customerInfo['tel']=options.tel;
      customerInfo['name']=options.name;
      that.setData({customerInfo:customerInfo})
      wx.getUserInfo({
        success: function (res) {
          that.setData({
            userInfo: res.userInfo
          })
        }
      })
    }else{
      wx.navigateBack({});
    }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },
  fnToAddr:function(){
    wx.navigateTo({
      url: '/pages/perCenter/shipAddr/shipAddr',
    })
  },
  fnToBank:function(){
    wx.navigateTo({
      url: '/pages/perCenter/bankList/bankList',
    })
  },
  fnToContact: function () {
    wx.navigateTo({
      url: '/pages/perCenter/contacts/contacts',
    })
  },
})